package com.xbongbong.pro.domain.dao;

import com.xbongbong.pro.domain.entity.CloudCodePermissionEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface CloudCodePermissionDao {
    Long insert(CloudCodePermissionEntity entity);

    void insertBatch(List<CloudCodePermissionEntity> list);

    CloudCodePermissionEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    CloudCodePermissionEntity getByAlias(@Param("alias") String alias, @Param("corpid") String corpid);

    Long update(CloudCodePermissionEntity entity);

    List<CloudCodePermissionEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitiesCount(@Param("param") Map<String, Object> param);

    Long deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Long deleteByAlias(@Param("corpid") String corpid, @Param("alias") String alias);
}